<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns number of hits for last search</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.yaz-get-option.html">yaz_get_option</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.yaz-itemorder.html">yaz_itemorder</a></div>
 <div class="up"><a href="ref.yaz.html">YAZ 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.yaz-hits" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">yaz_hits</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.1, PECL yaz &gt;= 0.9.0)</p><p class="refpurpose"><span class="refname">yaz_hits</span> &mdash; <span class="dc-title">Returns number of hits for last search</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.yaz-hits-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>yaz_hits</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$id</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter reference">&$searchresult</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>yaz_hits()</strong></span> returns the number of hits for the last
   search. 
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.yaz-hits-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">id</code></em></dt>

     <dd>

      <p class="para">
       The connection resource returned by <span class="function"><a href="function.yaz-connect.html" class="function">yaz_connect()</a></span>.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">searchresult</code></em></dt>

     <dd>

      <p class="para">
       Result array for detailed search result information.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.yaz-hits-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the number of hits for the last search or 0 if no search was 
   performed.
  </p>
  <p class="para">
   The search result array (if supplied) holds information that
   is returned by a Z39.50 server in the SearchResult-1
   format part of a search response.
   The SearchResult-1 format can be used to obtain information
   about hit counts for various parts of the query (subquery).
   In particular, it is possible to obtain hit counts for the individual
   search terms in a query. Information for first
   subquery is in $array[0], second subquery in $array[1], and so forth.
  </p>
  <table class="doctable table">
   <caption><strong>searchresult members</strong></caption>
   
    <col width="1*" />
    <col width="2*" />
    <thead>
     <tr>
      <th>Element</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><em>id</em></td>
      <td>Sub query ID2 (string)</td>
     </tr>

     <tr>
      <td><em>count</em></td>
      <td>Result count / hits (integer)</td>
     </tr>

     <tr>
      <td><em>subquery.term</em></td>
      <td>Sub query term (string)</td>
     </tr>

     <tr>
      <td><em>interpretation.term</em></td>
      <td>Interpretated sub query term (string)</td>
     </tr>

     <tr>
      <td><em>recommendation.term</em></td>
      <td>Recommended sub query term (string)</td>
     </tr>

    </tbody>
   
  </table>
     
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    The SearchResult facility requires PECL YAZ 1.0.5
    or later and YAZ 2.1.9 or later.
   </p>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Very few Z39.50 implementations support the SearchResult facility.
   </p>
  </p></blockquote>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.yaz-get-option.html">yaz_get_option</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.yaz-itemorder.html">yaz_itemorder</a></div>
 <div class="up"><a href="ref.yaz.html">YAZ 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
